<%@ page contentType="text/html; charset=UTF-8" language="java" import="java.util.*,org.yoao.crm.struts.form.RoleForm,org.yoao.crm.acl.ACLConstants"%>
<%
   	String base = request.getContextPath();
   	RoleForm form = (RoleForm)request.getAttribute("ROLEFORM");
   	List list = (List)request.getAttribute("ROLECHILDS");
   	String actionPermission = form.getActionPermission();
   	if(actionPermission == null){actionPermission = "";}
%>
<html>
<head>
<title>角色管理</title>
<jsp:include page="../public/publicJs.jsp" flush="false"></jsp:include>
<script src="<%=base%>/js/validator.js"></script>
</head>
<body topmargin="0" leftmargin="0" class="dialog" onLoad="public_onload();">
<form name="addForm" method="post" action="<%=base%>/role.crm?method=modify" onSubmit="return checkData(this);">
<input name="id" type="hidden" value="<%=form.getId()%>"/>
<table class="maintab_content_table" border="0" width="100%" cellspacing="0" cellpadding="0" height="25">
	<tr class="tree_title_txt">
		<td nowrap width="100%" class="tree_title_txt" valign="middle" id="cwCellTopTitTxt">
			<font color="#154288">角色管理 </font>
		</td>
	</tr>
</table>
<table class="title_top" width=100% height=100% align=center cellspacing=0 border="0" cellpadding="0">
<tr valign="top">
 <td  align=center width=100% height=100%>
   <table align=center width=96% border="0" cellspacing="0" cellpadding="0" style="margin-top:12px">
		<tr valign="top">
			<td width="100%">
			<table border="0" cellspacing="0" cellpadding="0">
				<tr valign="top">
					<td id="Form_tab_0" class="Form_tab" width=80 align=center valign="middle" height="20">修改</td>
				</tr>
			</table>
			</td>
		</tr>
		<tr valign="top">
			<td class="tab_subline" width="100%"></td>
		</tr>
    </table>

    <center>
	<div class="tabBody">
		<table width=98% align="center" width="100%" border="0" cellspacing="0" cellpadding="0" class="maintab_content_table">
			<tr valign="top">
				<td class="Form_BBS_Lable" width=160 width="14%" valign="middle">&nbsp;&nbsp;角色代码</td>
				<td class="Form_BBS_td" width="86%" valign="middle"><%=form.getRoleId()%><input name="roleId" type="hidden" value="<%=form.getRoleId()%>"/></td>
	    	</tr>

			<tr valign="top">
				<td class="Form_BBS_Lable" width=160 width="14%" valign="middle">&nbsp;&nbsp;父角色</td>
				<td class="Form_BBS_td" width="86%" valign="middle">
				<select name="parentId" class="text_220" style="width:250px" Require="true">
          				<option value="">
           			<%
           				if(list != null){
           					for(int i=0;i<list.size();i++){
           						Map map = (Map)list.get(i);
					%>
									<option value="<%=map.get("ROLEID")%>" <%if(map.get("ROLEID").toString().equals(form.getParentId())){%>selected<%}%>><%=map.get("ROLENAME")%>
					<%
           					}
           				}
           			%>
         			</select>&nbsp;<span class="biTian">*</span>
				</td>
	    	</tr>

	    	<tr>
	           	<td class="Form_BBS_Lable" width=160 width="14%" valign="middle">&nbsp;&nbsp;角色名称</td>
       			<td><input class="text_220" style="width:250px" name="roleName" type="text" value="<%=form.getRoleName()%>" size="20" maxB="20" Require="true"/>&nbsp;<span class="biTian">*</span></td>
       		</tr>
       		<tr>
	           	<td class="Form_BBS_Lable" width=160 width="14%" valign="top">&nbsp;&nbsp;操作</td>
       			<td>
       				<table width="100%" align="left" border="0" cellspacing="0" cellpadding="0">
       					<tr>
       						<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_SEARCH%>" <%if(actionPermission.contains(ACLConstants.AP_SEARCH)){%>checked<%}%> />搜索</td>
       						<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_SEARCH_ALL%>" <%if(actionPermission.contains(ACLConstants.AP_SEARCH_ALL)){%>checked<%}%> />全搜索</td>
       						<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_NEW%>" <%if(actionPermission.contains(ACLConstants.AP_NEW)){%>checked<%}%> />新增</td>
       						<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_MODIFY%>" <%if(actionPermission.contains(ACLConstants.AP_MODIFY)){%>checked<%}%> />修改</td>
       						<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_DELETE%>" <%if(actionPermission.contains(ACLConstants.AP_DELETE)){%>checked<%}%> />删除</td>
       					</tr>
       					<tr>
       						<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_EXPORTIN%>" <%if(actionPermission.contains(ACLConstants.AP_EXPORTIN)){%>checked<%}%> />导入</td>
       						<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_EXPORTOUT%>" <%if(actionPermission.contains(ACLConstants.AP_EXPORTOUT)){%>checked<%}%> />导出</td>
       						<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_CANCEL%>" <%if(actionPermission.contains(ACLConstants.AP_CANCEL)){%>checked<%}%> />撤销</td>
       						<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_AUDIT%>" <%if(actionPermission.contains(ACLConstants.AP_AUDIT)){%>checked<%}%> />发货</td>
       						<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_PAY%>" <%if(actionPermission.contains(ACLConstants.AP_PAY)){%>checked<%}%> />已支付</td>
       					</tr>
       					<tr>
		       				<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_DOWNLOADTEMPLATE%>" <%if(actionPermission.contains(ACLConstants.AP_DOWNLOADTEMPLATE)){%>checked<%}%> />下载模板</td>
		       				<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_SIGNATURE_YES%>" <%if(actionPermission.contains(ACLConstants.AP_SIGNATURE_YES)){%>checked<%}%> />已签到</td>
		       				<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_SIGNATURE_NO%>" <%if(actionPermission.contains(ACLConstants.AP_SIGNATURE_NO)){%>checked<%}%> />未签到</td>
		       				<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_SUCCESS%>" <%if(actionPermission.contains(ACLConstants.AP_SUCCESS)){%>checked<%}%> />已成交</td>
		       				<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_ALLOCATION%>" <%if(actionPermission.contains(ACLConstants.AP_ALLOCATION)){%>checked<%}%> />分配业务员</td>
	       				</tr>
	       				<tr>
		       				<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_CUST_TYPE%>" <%if(actionPermission.contains(ACLConstants.AP_CUST_TYPE)){%>checked<%}%> />分配类型</td>
		       				<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_OPEN_USER%>" <%if(actionPermission.contains(ACLConstants.AP_OPEN_USER)){%>checked<%}%> />开通账户</td>
		       				<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_CLOSE_USER%>" <%if(actionPermission.contains(ACLConstants.AP_CLOSE_USER)){%>checked<%}%> />停用账户</td>
		       				<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_SMS%>" <%if(actionPermission.contains(ACLConstants.AP_SMS)){%>checked<%}%> />短信发送</td>
		       				<td><input type="checkbox" name="actionPermission" value="<%=ACLConstants.AP_MODIFY_MEMO%>" <%if(actionPermission.contains(ACLConstants.AP_MODIFY_MEMO)){%>checked<%}%> />修改备注</td>
	       				</tr>
       				</table>
       			</td>
       		</tr>
		</table>
	</div>
	</center>

	</br>
	<table width=96% align=center border="0" cellspacing="0" cellpadding="0" style="margin-top:-6px">
		<tr>
			<td width="75%" valign="middle"><div id="myLoad" style="text-align:left"></div></td>
			<td width="25%" valign="middle">
				<div align="right">
					<input type="submit" style="margin-right:8px" class="btn3_mouseout" value="保存" />
					<input type="button" onclick="self.close();opener.location.reload();" value="关闭" class="btn3_mouseout">
				</div>
			</td>
		</tr>
	</table>
<%
	if(form.getInfo() != null && form.getInfo().trim().length()>0){
%>
		<script type="text/javascript">
			document.getElementById("myLoad").innerHTML = "<img src='<%=base%>/images/info.gif' alt='数据保存信息' class='icon1' border='0' align='absmiddle'/> <%=form.getInfo()%>";
		</script>
<%
	}
%>
</td>
</tr>
</table>
</form>

<div id="ly" style="position:absolute;top:0px; filter:alpha(opacity=60); background-color:#777; z-index:2; left:0px; display:none"></div>
<div id="Layer2" align="center" style="display:none; background:#fff; width:160px;height:20px;left:40%;top:40%;position:absolute; padding: 5px 5px 5px 5px; z-index:3; filter:alpha(opacity=60);">
<font color="#FF0000" style="font-size:12px"><img src="<%=base%>/images/loading.gif" class="icon1"  border="0" align="absmiddle"/> 数据保存中,请稍后...</font>
</div>
<script language="javascript">ShowTabN(0);unLock();</script>
</body>
</Html>